#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "player.h"
#include <QMainWindow>
#include <QLabel>
#include <QPixmap>
#include <QPainter>
#include <QTimer>
#include <QTime>
#include <QPushButton>
#include <QPaintEvent>
#include <QtMultimedia/QMediaPlayer>
#include <QMediaPlaylist>
#include <QtMultimedia/QSound>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    QPixmap bg,p;
    QPushButton *start;
    player youngshen;
    int px,py,dmwx=-100,dmwy=300,pgx,pgy;
    bool flag[4]={0};
    bool l=0;
    bool f[4]={0};
    bool spawnd=1;
    bool meetxxz=0;
    bool ifxuanran=0;
    bool iffirst=0;
    bool instore=0;
    bool defadd=0,attadd=0,lifeadd=0,monsterkilled=0;
    int defa=0,atta=0,lifea=0,coia=0,expa=0;
    bool ifbattle=0,ifcanbattle;
    bool ifcrossgot=0;
    bool ifcanjump=0;
    bool ifcalljump=0;
    QMediaPlayer *faker;
    QMediaPlayer *attack;
    QMediaPlayer *got;
    QMediaPlayer *gotspe;
    QMediaPlayer *door;
    QMediaPlayer *vill;
    QMediaPlayer *co;
    QMediaPlayer *bla;
    QMediaPlayer *moveon;
    QMediaPlaylist *playlist;
    QMediaPlayer *sta;
    int ifs=0;
    int ifcango[27][11][11];
    int havewent[11][11];
    int c=0;
    int remainlife=0;
    int timetomeetgz=0;
    int kgx=0,kgy=0;
    int kx,ky;
    int tip=0,bbtip=0;
    bool ifbb=0;
    bool meetgz=0;
    bool xxkf[4]={0};
    bool ifkilldmw=0;
    bool iffinalmeetxxz=0;
    int maxfloor=0;
    int fz=0;
    monster a;
    QPushButton *x1,*x2,*x3,*x4,*y1,*y2,*y3,*y4;
    QLabel *background,*player,*npc1,*cov,*title,*dhk_zs,*dhk_xz,*dh_v[5],*dhk_ls,*dmw,*pb,*dhk_s[10],*dh_gz[8],*dh_q1,*dh_q2,*dh_cross[6],*k;
    QLabel *dh_bb[2],*dh_j[2],*dh_d[2],*dh_wls[7],*dh_jzh[7],*dh_dmw[4],*dh_xxz[5],*dh_mxxz[7];
    QLabel *t,*text,*tex;
    QPainter *bf;
    void setfloorcondition();
    void setdh_v();
    void dh_spawn();
    void dh_cros();
    void dh_gd();
    void dh_gj();
    void dh_bbgz();
    void dh_sj();
    void dh_sd();
    void dh_withls();
    void dh_wjzh1();
    void dh_wjzh2();
    void dh_faker();
    void dh_xianzi();
    void dh_finalwar();
    void keyPressEvent(QKeyEvent *e);
    void keyReleaseEvent(QKeyEvent *e);
    void paintEvent(QPaintEvent *);
    void canbattle();
    void battle();
    void buystore();
    void littleexpsotre();
    void keystore();
    void grandstore();
    void sellkeystore();
    void grandexpstore();
    void playwithgz();
public slots:
    void attad();
    void villa();
    void move();
    void lstore1();
    void lstore2();
    void lstore3();
    void lstore4();
    void lestore1();
    void lestore2();
    void lestore3();
    void lestore4();
    void kstore1();
    void kstore2();
    void kstore3();
    void kstore4();
    void gstore1();
    void gstore2();
    void gstore3();
    void gstore4();
    void skstore1();
    void skstore2();
    void skstore3();
    void skstore4();
    void gestore1();
    void gestore2();
    void gestore3();
    void gestore4();
    void cover();
    void spawn();
    void floor1();
    void floor2();
    void floor3();
    void floor4();
    void floor5();
    void floor6();
    void floor7();
    void floor8();
    void floor9();
    void floor10();
    void floor11();
    void floor12();
    void floor13();
    void floor14();
    void floor15();
    void floor16();
    void floor17();
    void floor18();
    void floor19();
    void floor20();
    void floor21();
    void floor22();
    void floor23();
    void floor24();
    void floor25();
    void floor26();
    void xxkz();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
